**********************************************************
/*Stata .do file for conjoint experiment in Shi, L, & Denver, D. (Forthcoming). The Transferal of Criminal Record Stigma in the Employment Context: Evidence from Conjoint and Vignette Experiments. Criminology.*/
**********************************************************

***************************************************************************
/*Figure 3 and Appendix F: Weighted Conjoint Figure and Regression Results*/
***************************************************************************
numlabel _all, add
svyset [pw= weight]

regress pref i.p_distance i.p_price i.p_review i.p_initiative i.p_staff [pw = weight], cluster (caseid)
estimates store model

coefplot model, drop (_cons) xline(0) omitted baselevels ylab(, labs(vsmall)) ///
		msize(vsmall) headings(1.p_distance="{bf:Distance}" 1.p_price="{bf:Price}" ///
		1.p_review="{bf:Food Quality}" 1.p_initiative="{bf:Hiring Initiative}" ///
		1.p_staff="{bf:Staff Composition}" , labsize (vsmall) labgap(0))

***************************************************************************
/*Figure 4: Weighted Conjoint by Respondents' Race*/
***************************************************************************
conjoint pref p_distance p_price p_review p_initiative p_staff, est(mm) id(caseid) graph subgroup(race_WBO)

regress pref i.p_distance##race_WBO i.p_price##race_WBO i.p_review##race_WBO i.p_initiative##race_WBO i.p_staff##race_WBO [pw = weight], cluster (caseid)
margins i.p_staff#race_WBO
*marginsplot

margins i.p_distance#race_WBO
margins i.p_price#race_WBO
margins i.p_review#race_WBO
margins i.p_initiative#race_WBO

***************************************************************************
/*Appendix A: Unweighted Conjoint*/
***************************************************************************
regress pref i.p_distance i.p_price i.p_review i.p_initiative i.p_staff, cluster (caseid)
estimates store model	

*************************************************************************
/*Appendix C: Descriptive Statistics (N=9980)*/
**************************************************************************
svy:tab p_distance 
svy:tab p_price 
svy:tab p_review 
svy:tab p_initiative 
svy:tab p_staff
svy:tab pref 
